#ifndef SCENEMAN_H__
#define SCENEMAN_H__
#include "ProjectHeader.h"

class SceneMan
{
public:
	SceneMan();
	bool ContainsPoint(vertex2f point);
	bool ContainsBox(vertex2f btmLeft, vertex2f topRight);
	//the winding of v1->v2->v3->v4 must be CCW
	bool Draw(std::vector<vertex> * VboVec, const std::map<int, texCoord2f>& TexMap, GLuint TexAtlas = 0);

private:

	GLuint xSize;	//The size of CubeMap along the x axis
	GLuint ySize;	//The size of CubeMap along the y axis
	std::vector<std::vector<CUBE_PROTO_INDEX>> CubeMap;	//Stores the cube type at [x][y], as an index into Cubes[]
	std::map<int, Cube_Prototype> Cubes;	//Stores cube prototypes		
	GLfloat GridSpace;	//The size along each edge of a cube
	bool DrawableFace(GLuint x, GLuint y, int Face);	//returns true if the face is drawable, eg not hidden by an adjacent cube
	void addToVbo(vertex3f v1, vertex3f v2, vertex3f v3, vertex3f v4, vertex3f n1, GLuint Tex, std::vector<GLfloat> * VboVec);

	//If these are changed, BuildDisplayList can break; 
	//it'd definatly be bad if either was greater than the respective dimension of CubeMap
};
#endif